#include <bits/stdc++.h>

using namespace std;

const int maxn = 10;
int book[maxn];
int a[] = {1, 2, 3, 4, 5, 6};
int n = 6;
int t = 10;

void dfs(int k) {//depth first search
    if (k >= n) {
        int s = 0;
        for (int i = 0; i < n; i++) {
            if (book[i] == 1) {
                s += a[i];
            }
        }
        if (s == t) {
            for (int i = 0; i < n; i++) {
                if (book[i])cout << a[i];
            }
            cout << endl;
        }
        return;
    }
    book[k] = 0;
    dfs(k + 1);
    book[k] = 1;
    dfs(k + 1);

}

int main() {
    dfs(0);
}
